package com.ruoyi.service.account.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.service.account.entity.LaborAccountDetailEntity;
import com.ruoyi.service.account.mapper.LaborAccountDetailMapper;
import com.ruoyi.service.account.query.LaborAccountQuery;
import com.ruoyi.service.account.service.LaborAccountDetailService;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 员工账户变动明细 服务实现类
 * </p>
 *
 * @author Zane
 * @since 2025-10-19
 */
@Service
public class LaborAccountDetailServiceImpl
    extends ServiceImpl<LaborAccountDetailMapper, LaborAccountDetailEntity>
    implements LaborAccountDetailService {

  @Override
  public List<LaborAccountDetailEntity> accountList(LaborAccountQuery query, Long userId) {
    return list(queryWrapper().eq(LaborAccountDetailEntity::getLaborId, userId)
        .orderByDesc(LaborAccountDetailEntity::getId));
  }

  private LambdaQueryWrapper<LaborAccountDetailEntity> queryWrapper() {
    return new LambdaQueryWrapper<>();
  }
}
